<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------


Route::group([], function () {
    Route::post('login$','index/Login/index');
    Route::any('refresh_token$','index/Login/refresh',['method' => 'post']);

    //管理员管理
    Route::any('manager$','index/Manager/index',['method'=>'get']);
    Route::any('manager/add$','index/Manager/add',['method'=>'post']);
    Route::any('manager/edit$','index/Manager/edit',['method'=>'post']);
    Route::any('manager/del$','index/Manager/del',['method'=>'post']);
    Route::any('manager/getgroupid$','index/Manager/getGroupid',['method'=>'get']);
    Route::any('manager/allrole$','index/Manager/Allrole',['method'=>'get']);
    Route::any('manager/setaccess$','index/Manager/setAccess',['method'=>'post']);
    //规则管理
    Route::any('rule$','index/Rule/index',['method'=>'get']);
    Route::any('rule/add$','index/Rule/add',['method'=>'post']);
    Route::any('rule/edit$','index/Rule/edit',['method'=>'post']);
    Route::any('rule/del$','index/Rule/del',['method'=>'post']);
    //角色管理
    Route::any('role$','index/Role/index',['method'=>'get']);
    Route::any('role/add$','index/Role/add',['method'=>'post']);
    Route::any('role/edit$','index/Role/edit',['method'=>'post']);
    Route::any('role/del$','index/Role/del',['method'=>'post']);
    Route::any('role/treemenu$','index/Role/getRuleMenu',['method'=>'get']);



    //不验证的权限控制器
    Route::get('getmenu$','index/NoAuth/getmenu');
    Route::any('bindmenu$','index/NoAuth/bindmenu',['method' => 'post']);
    Route::get('ruletree$','index/NoAuth/ruletree');
    Route::any('upload$','index/NoAuth/upload',['method' => 'post']);

    Route::post('cache$','index/NoAuth/clearcache');
})->allowCrossDomain();

//CMS管理
Route::group([], function () {
    //栏目管理
    Route::any('cms/category$','cms/Category/index',['method'=>'get']);
    Route::any('cms/category/add$','cms/Category/add',['method'=>'post']);
    Route::any('cms/category/edit$','cms/Category/edit',['method'=>'post']);
    Route::any('cms/category/del$','cms/Category/del',['method'=>'post']);
    Route::any('cms/category/catetree$','cms/Category/catetree',['method'=>'get']);

    //文章管理
    Route::any('cms/article$','cms/Article/index',['method'=>'get']);
    Route::any('cms/article/add$','cms/Article/add',['method'=>'post']);
    Route::any('cms/article/edit$','cms/Article/edit',['method'=>'post']);
    Route::any('cms/article/del$','cms/Article/del',['method'=>'post']);
    Route::any('cms/article/move$','cms/Article/move',['method'=>'post']);
    Route::any('cms/article/getcate$','cms/Article/getcate',['method'=>'get']);
    Route::any('cms/article/getone$','cms/Article/getone',['method'=>'get']);
    Route::any('cms/article/gettags$','cms/Article/gettags',['method'=>'get']);
    Route::any('cms/article/settags$','cms/Article/settags',['method'=>'post']);

    //标签管理
    Route::any('cms/tags$','cms/Tags/index',['method'=>'get']);
    Route::any('cms/tags/add$','cms/Tags/add',['method'=>'post']);
    Route::any('cms/tags/edit$','cms/Tags/edit',['method'=>'post']);
    Route::any('cms/tags/del$','cms/Tags/del',['method'=>'post']);

    //广告位管理
    Route::any('cms/ads$','cms/Ads/index',['method'=>'get']);
    Route::any('cms/ads/add$','cms/Ads/add',['method'=>'post']);
    Route::any('cms/ads/edit$','cms/Ads/edit',['method'=>'post']);
    Route::any('cms/ads/del$','cms/Ads/del',['method'=>'post']);
    //广告管理
    Route::any('cms/adsdata$','cms/AdsData/index',['method'=>'get']);
    Route::any('cms/adsdata/getone$','cms/AdsData/getone',['method'=>'get']);
    Route::any('cms/adsdata/add$','cms/AdsData/add',['method'=>'post']);
    Route::any('cms/adsdata/edit$','cms/AdsData/edit',['method'=>'post']);
    Route::any('cms/adsdata/del$','cms/AdsData/del',['method'=>'post']);
    //采集管理
    Route::any('cms/collection$','cms/Collection/index',['method'=>'get']);
    Route::any('cms/collection/add$','cms/Collection/add',['method'=>'post']);
    Route::any('cms/collection/edit$','cms/Collection/edit',['method'=>'post']);
    Route::any('cms/collection/del$','cms/Collection/del',['method'=>'post']);
    //推荐位
    Route::any('cms/position$','cms/Position/index',['method'=>'get']);
    Route::any('cms/position/add$','cms/Position/add',['method'=>'post']);
    Route::any('cms/position/edit$','cms/Position/edit',['method'=>'post']);
    Route::any('cms/position/del$','cms/Position/del',['method'=>'post']);
    Route::any('cms/position/catetree$','cms/Position/catetree',['method'=>'get']);
    //推荐文章管理
    Route::any('cms/positionlist$','cms/PositionList/index',['method'=>'get']);
    Route::any('cms/positionlist/getone$','cms/PositionList/getone',['method'=>'get']);
    Route::any('cms/positionlist/add$','cms/PositionList/add',['method'=>'post']);
    Route::any('cms/positionlist/edit$','cms/PositionList/edit',['method'=>'post']);
    Route::any('cms/positionlist/del$','cms/PositionList/del',['method'=>'post']);

    //菜单管理
    Route::any('cms/menu$','cms/Menu/index',['method'=>'get']);
    Route::any('cms/menu/add$','cms/Menu/add',['method'=>'post']);
    Route::any('cms/menu/edit$','cms/Menu/edit',['method'=>'post']);
    Route::any('cms/menu/del$','cms/Menu/del',['method'=>'post']);
    Route::any('cms/menu/menutree$','cms/Menu/menutree',['method'=>'get']);
    //配置管理
    Route::any('cms/setting$','cms/Setting/index',['method'=>'get']);
    Route::any('cms/setting/edit$','cms/Setting/edit',['method'=>'post']);

})->allowCrossDomain();

Route::miss('index/Login/miss');
